3.11.52 \(\int (a+i a \tan (e+f x))^m (c-i c \tan (e+f x))^3 \, dx\) [1052]

Optimal. Leaf size=99 \[ -\frac {4 i c^3 (a+i a \tan (e+f x))^m}{f m}+\frac {4 i c^3 (a+i a \tan (e+f x))^{1+m}}{a f (1+m)}-\frac {i c^3 (a+i a \tan (e+f x))^{2+m}}{a^2 f (2+m)} \]

[Out]

-4*I*c^3*(a+I*a*tan(f*x+e))^m/f/m+4*I*c^3*(a+I*a*tan(f*x+e))^(1+m)/a/f/(1+m)-I*c^3*(a+I*a*tan(f*x+e))^(2+m)/a^
2/f/(2+m)

________________________________________________________________________________________

Rubi [A]
time = 0.10, antiderivative size = 99, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, Rules used = {3603, 3568, 45} \begin {gather*} -\frac {i c^3 (a+i a \tan (e+f x))^{m+2}}{a^2 f (m+2)}-\frac {4 i c^3 (a+i a \tan (e+f x))^m}{f m}+\frac {4 i c^3 (a+i a \tan (e+f x))^{m+1}}{a f (m+1)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])^m*(c - I*c*Tan[e + f*x])^3,x]

[Out]

((-4*I)*c^3*(a + I*a*Tan[e + f*x])^m)/(f*m) + ((4*I)*c^3*(a + I*a*Tan[e + f*x])^(1 + m))/(a*f*(1 + m)) - (I*c^
3*(a + I*a*Tan[e + f*x])^(2 + m))/(a^2*f*(2 + m))

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 3568

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rule 3603

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Di
st[a^m*c^m, Int[Sec[e + f*x]^(2*m)*(c + d*Tan[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] &&
EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0] && IntegerQ[m] &&  !(IGtQ[n, 0] && (LtQ[m, 0] || GtQ[m, n]))

Rubi steps

\begin {align*} \int (a+i a \tan (e+f x))^m (c-i c \tan (e+f x))^3 \, dx &=\left (a^3 c^3\right ) \int \sec ^6(e+f x) (a+i a \tan (e+f x))^{-3+m} \, dx\\ &=-\frac {\left (i c^3\right ) \text {Subst}\left (\int (a-x)^2 (a+x)^{-1+m} \, dx,x,i a \tan (e+f x)\right )}{a^2 f}\\ &=-\frac {\left (i c^3\right ) \text {Subst}\left (\int \left (4 a^2 (a+x)^{-1+m}-4 a (a+x)^m+(a+x)^{1+m}\right ) \, dx,x,i a \tan (e+f x)\right )}{a^2 f}\\ &=-\frac {4 i c^3 (a+i a \tan (e+f x))^m}{f m}+\frac {4 i c^3 (a+i a \tan (e+f x))^{1+m}}{a f (1+m)}-\frac {i c^3 (a+i a \tan (e+f x))^{2+m}}{a^2 f (2+m)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 14.76, size = 161, normalized size = 1.63 \begin {gather*} -\frac {i 2^{2+m} c^3 \left (e^{i f x}\right )^m \left (\frac {e^{i (e+f x)}}{1+e^{2 i (e+f x)}}\right )^m \left (2+2 e^{4 i (e+f x)}+3 m+m^2+2 e^{2 i (e+f x)} (2+m)\right ) \sec ^{-m}(e+f x) (\cos (f x)+i \sin (f x))^{-m} (a+i a \tan (e+f x))^m}{\left (1+e^{2 i (e+f x)}\right )^2 f m (1+m) (2+m)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])^m*(c - I*c*Tan[e + f*x])^3,x]

[Out]

((-I)*2^(2 + m)*c^3*(E^(I*f*x))^m*(E^(I*(e + f*x))/(1 + E^((2*I)*(e + f*x))))^m*(2 + 2*E^((4*I)*(e + f*x)) + 3
*m + m^2 + 2*E^((2*I)*(e + f*x))*(2 + m))*(a + I*a*Tan[e + f*x])^m)/((1 + E^((2*I)*(e + f*x)))^2*f*m*(1 + m)*(
2 + m)*Sec[e + f*x]^m*(Cos[f*x] + I*Sin[f*x])^m)

________________________________________________________________________________________

Maple [A]
time = 1.21, size = 129, normalized size = 1.30

method result size
norman \(\frac {i c^{3} \left (\tan ^{2}\left (f x +e \right )\right ) {\mathrm e}^{m \ln \left (a +i a \tan \left (f x +e \right )\right )}}{f \left (2+m \right )}-\frac {2 c^{3} \left (3+m \right ) \tan \left (f x +e \right ) {\mathrm e}^{m \ln \left (a +i a \tan \left (f x +e \right )\right )}}{f \left (1+m \right ) \left (2+m \right )}-\frac {i c^{3} \left (m^{2}+5 m +8\right ) {\mathrm e}^{m \ln \left (a +i a \tan \left (f x +e \right )\right )}}{f m \left (1+m \right ) \left (2+m \right )}\) \(129\)
risch \(\text {Expression too large to display}\) \(3221\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))^m*(c-I*c*tan(f*x+e))^3,x,method=_RETURNVERBOSE)

[Out]

I/f/(2+m)*c^3*tan(f*x+e)^2*exp(m*ln(a+I*a*tan(f*x+e)))-2*c^3*(3+m)/f/(1+m)/(2+m)*tan(f*x+e)*exp(m*ln(a+I*a*tan
(f*x+e)))-I*c^3*(m^2+5*m+8)/f/m/(1+m)/(2+m)*exp(m*ln(a+I*a*tan(f*x+e)))

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^m*(c-I*c*tan(f*x+e))^3,x, algorithm="maxima")

[Out]

integrate((-I*c*tan(f*x + e) + c)^3*(I*a*tan(f*x + e) + a)^m, x)

________________________________________________________________________________________

Fricas [A]
time = 1.03, size = 163, normalized size = 1.65 \begin {gather*} -\frac {4 \, {\left (i \, c^{3} m^{2} + 3 i \, c^{3} m + 2 i \, c^{3} e^{\left (4 i \, f x + 4 i \, e\right )} + 2 i \, c^{3} + 2 \, {\left (i \, c^{3} m + 2 i \, c^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \left (\frac {2 \, a e^{\left (2 i \, f x + 2 i \, e\right )}}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{m}}{f m^{3} + 3 \, f m^{2} + 2 \, f m + {\left (f m^{3} + 3 \, f m^{2} + 2 \, f m\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, {\left (f m^{3} + 3 \, f m^{2} + 2 \, f m\right )} e^{\left (2 i \, f x + 2 i \, e\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^m*(c-I*c*tan(f*x+e))^3,x, algorithm="fricas")

[Out]

-4*(I*c^3*m^2 + 3*I*c^3*m + 2*I*c^3*e^(4*I*f*x + 4*I*e) + 2*I*c^3 + 2*(I*c^3*m + 2*I*c^3)*e^(2*I*f*x + 2*I*e))
*(2*a*e^(2*I*f*x + 2*I*e)/(e^(2*I*f*x + 2*I*e) + 1))^m/(f*m^3 + 3*f*m^2 + 2*f*m + (f*m^3 + 3*f*m^2 + 2*f*m)*e^
(4*I*f*x + 4*I*e) + 2*(f*m^3 + 3*f*m^2 + 2*f*m)*e^(2*I*f*x + 2*I*e))

________________________________________________________________________________________

Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 979 vs. \(2 (80) = 160\).
time = 0.87, size = 979, normalized size = 9.89 \begin {gather*} \begin {cases} x \left (i a \tan {\left (e \right )} + a\right )^{m} \left (- i c \tan {\left (e \right )} + c\right )^{3} & \text {for}\: f = 0 \\\frac {2 c^{3} f x \tan ^{2}{\left (e + f x \right )}}{2 a^{2} f \tan ^{2}{\left (e + f x \right )} - 4 i a^{2} f \tan {\left (e + f x \right )} - 2 a^{2} f} - \frac {4 i c^{3} f x \tan {\left (e + f x \right )}}{2 a^{2} f \tan ^{2}{\left (e + f x \right )} - 4 i a^{2} f \tan {\left (e + f x \right )} - 2 a^{2} f} - \frac {2 c^{3} f x}{2 a^{2} f \tan ^{2}{\left (e + f x \right )} - 4 i a^{2} f \tan {\left (e + f x \right )} - 2 a^{2} f} - \frac {i c^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )} \tan ^{2}{\left (e + f x \right )}}{2 a^{2} f \tan ^{2}{\left (e + f x \right )} - 4 i a^{2} f \tan {\left (e + f x \right )} - 2 a^{2} f} - \frac {2 c^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )} \tan {\left (e + f x \right )}}{2 a^{2} f \tan ^{2}{\left (e + f x \right )} - 4 i a^{2} f \tan {\left (e + f x \right )} - 2 a^{2} f} + \frac {i c^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 a^{2} f \tan ^{2}{\left (e + f x \right )} - 4 i a^{2} f \tan {\left (e + f x \right )} - 2 a^{2} f} - \frac {8 c^{3} \tan {\left (e + f x \right )}}{2 a^{2} f \tan ^{2}{\left (e + f x \right )} - 4 i a^{2} f \tan {\left (e + f x \right )} - 2 a^{2} f} + \frac {4 i c^{3}}{2 a^{2} f \tan ^{2}{\left (e + f x \right )} - 4 i a^{2} f \tan {\left (e + f x \right )} - 2 a^{2} f} & \text {for}\: m = -2 \\- \frac {4 c^{3} f x \tan {\left (e + f x \right )}}{a f \tan {\left (e + f x \right )} - i a f} + \frac {4 i c^{3} f x}{a f \tan {\left (e + f x \right )} - i a f} + \frac {2 i c^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )} \tan {\left (e + f x \right )}}{a f \tan {\left (e + f x \right )} - i a f} + \frac {2 c^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{a f \tan {\left (e + f x \right )} - i a f} + \frac {c^{3} \tan ^{2}{\left (e + f x \right )}}{a f \tan {\left (e + f x \right )} - i a f} + \frac {5 c^{3}}{a f \tan {\left (e + f x \right )} - i a f} & \text {for}\: m = -1 \\4 c^{3} x - \frac {2 i c^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{f} + \frac {i c^{3} \tan ^{2}{\left (e + f x \right )}}{2 f} - \frac {3 c^{3} \tan {\left (e + f x \right )}}{f} & \text {for}\: m = 0 \\\frac {i c^{3} m^{2} \left (i a \tan {\left (e + f x \right )} + a\right )^{m} \tan ^{2}{\left (e + f x \right )}}{f m^{3} + 3 f m^{2} + 2 f m} - \frac {2 c^{3} m^{2} \left (i a \tan {\left (e + f x \right )} + a\right )^{m} \tan {\left (e + f x \right )}}{f m^{3} + 3 f m^{2} + 2 f m} - \frac {i c^{3} m^{2} \left (i a \tan {\left (e + f x \right )} + a\right )^{m}}{f m^{3} + 3 f m^{2} + 2 f m} + \frac {i c^{3} m \left (i a \tan {\left (e + f x \right )} + a\right )^{m} \tan ^{2}{\left (e + f x \right )}}{f m^{3} + 3 f m^{2} + 2 f m} - \frac {6 c^{3} m \left (i a \tan {\left (e + f x \right )} + a\right )^{m} \tan {\left (e + f x \right )}}{f m^{3} + 3 f m^{2} + 2 f m} - \frac {5 i c^{3} m \left (i a \tan {\left (e + f x \right )} + a\right )^{m}}{f m^{3} + 3 f m^{2} + 2 f m} - \frac {8 i c^{3} \left (i a \tan {\left (e + f x \right )} + a\right )^{m}}{f m^{3} + 3 f m^{2} + 2 f m} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))**m*(c-I*c*tan(f*x+e))**3,x)

[Out]

Piecewise((x*(I*a*tan(e) + a)**m*(-I*c*tan(e) + c)**3, Eq(f, 0)), (2*c**3*f*x*tan(e + f*x)**2/(2*a**2*f*tan(e
+ f*x)**2 - 4*I*a**2*f*tan(e + f*x) - 2*a**2*f) - 4*I*c**3*f*x*tan(e + f*x)/(2*a**2*f*tan(e + f*x)**2 - 4*I*a*
*2*f*tan(e + f*x) - 2*a**2*f) - 2*c**3*f*x/(2*a**2*f*tan(e + f*x)**2 - 4*I*a**2*f*tan(e + f*x) - 2*a**2*f) - I
*c**3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(2*a**2*f*tan(e + f*x)**2 - 4*I*a**2*f*tan(e + f*x) - 2*a**2*f)
 - 2*c**3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*a**2*f*tan(e + f*x)**2 - 4*I*a**2*f*tan(e + f*x) - 2*a**2*f
) + I*c**3*log(tan(e + f*x)**2 + 1)/(2*a**2*f*tan(e + f*x)**2 - 4*I*a**2*f*tan(e + f*x) - 2*a**2*f) - 8*c**3*t
an(e + f*x)/(2*a**2*f*tan(e + f*x)**2 - 4*I*a**2*f*tan(e + f*x) - 2*a**2*f) + 4*I*c**3/(2*a**2*f*tan(e + f*x)*
*2 - 4*I*a**2*f*tan(e + f*x) - 2*a**2*f), Eq(m, -2)), (-4*c**3*f*x*tan(e + f*x)/(a*f*tan(e + f*x) - I*a*f) + 4
*I*c**3*f*x/(a*f*tan(e + f*x) - I*a*f) + 2*I*c**3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(a*f*tan(e + f*x) - I*
a*f) + 2*c**3*log(tan(e + f*x)**2 + 1)/(a*f*tan(e + f*x) - I*a*f) + c**3*tan(e + f*x)**2/(a*f*tan(e + f*x) - I
*a*f) + 5*c**3/(a*f*tan(e + f*x) - I*a*f), Eq(m, -1)), (4*c**3*x - 2*I*c**3*log(tan(e + f*x)**2 + 1)/f + I*c**
3*tan(e + f*x)**2/(2*f) - 3*c**3*tan(e + f*x)/f, Eq(m, 0)), (I*c**3*m**2*(I*a*tan(e + f*x) + a)**m*tan(e + f*x
)**2/(f*m**3 + 3*f*m**2 + 2*f*m) - 2*c**3*m**2*(I*a*tan(e + f*x) + a)**m*tan(e + f*x)/(f*m**3 + 3*f*m**2 + 2*f
*m) - I*c**3*m**2*(I*a*tan(e + f*x) + a)**m/(f*m**3 + 3*f*m**2 + 2*f*m) + I*c**3*m*(I*a*tan(e + f*x) + a)**m*t
an(e + f*x)**2/(f*m**3 + 3*f*m**2 + 2*f*m) - 6*c**3*m*(I*a*tan(e + f*x) + a)**m*tan(e + f*x)/(f*m**3 + 3*f*m**
2 + 2*f*m) - 5*I*c**3*m*(I*a*tan(e + f*x) + a)**m/(f*m**3 + 3*f*m**2 + 2*f*m) - 8*I*c**3*(I*a*tan(e + f*x) + a
)**m/(f*m**3 + 3*f*m**2 + 2*f*m), True))

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^m*(c-I*c*tan(f*x+e))^3,x, algorithm="giac")

[Out]

integrate((-I*c*tan(f*x + e) + c)^3*(I*a*tan(f*x + e) + a)^m, x)

________________________________________________________________________________________

Mupad [B]
time = 1.36, size = 229, normalized size = 2.31 \begin {gather*} -\frac {2\,c^3\,{\left (\frac {a\,\left (\cos \left (2\,e+2\,f\,x\right )+1+\sin \left (2\,e+2\,f\,x\right )\,1{}\mathrm {i}\right )}{\cos \left (2\,e+2\,f\,x\right )+1}\right )}^m\,\left (m\,7{}\mathrm {i}+\cos \left (2\,e+2\,f\,x\right )\,16{}\mathrm {i}+\cos \left (4\,e+4\,f\,x\right )\,4{}\mathrm {i}+2\,m^2\,\sin \left (2\,e+2\,f\,x\right )+m^2\,\sin \left (4\,e+4\,f\,x\right )+m\,\cos \left (2\,e+2\,f\,x\right )\,10{}\mathrm {i}+m\,\cos \left (4\,e+4\,f\,x\right )\,3{}\mathrm {i}+6\,m\,\sin \left (2\,e+2\,f\,x\right )+3\,m\,\sin \left (4\,e+4\,f\,x\right )+m^2\,1{}\mathrm {i}+m^2\,\cos \left (2\,e+2\,f\,x\right )\,2{}\mathrm {i}+m^2\,\cos \left (4\,e+4\,f\,x\right )\,1{}\mathrm {i}+12{}\mathrm {i}\right )}{f\,m\,\left (4\,\cos \left (2\,e+2\,f\,x\right )+\cos \left (4\,e+4\,f\,x\right )+3\right )\,\left (m^2+3\,m+2\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*tan(e + f*x)*1i)^m*(c - c*tan(e + f*x)*1i)^3,x)

[Out]

-(2*c^3*((a*(cos(2*e + 2*f*x) + sin(2*e + 2*f*x)*1i + 1))/(cos(2*e + 2*f*x) + 1))^m*(m*7i + cos(2*e + 2*f*x)*1
6i + cos(4*e + 4*f*x)*4i + 2*m^2*sin(2*e + 2*f*x) + m^2*sin(4*e + 4*f*x) + m*cos(2*e + 2*f*x)*10i + m*cos(4*e
+ 4*f*x)*3i + 6*m*sin(2*e + 2*f*x) + 3*m*sin(4*e + 4*f*x) + m^2*1i + m^2*cos(2*e + 2*f*x)*2i + m^2*cos(4*e + 4
*f*x)*1i + 12i))/(f*m*(4*cos(2*e + 2*f*x) + cos(4*e + 4*f*x) + 3)*(3*m + m^2 + 2))

________________________________________________________________________________________